/**
 * 作者：陈文斌 on 2019/1/26.
 * 邮箱：chen_wennbin@163.com
 * 版本：v1.0
 */

import 'package:flutter/material.dart';
import 'package:crm/constant/constant.dart';

class PainPointDetailSection extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return _PainPointDetailSectionState();
  }
}

class _PainPointDetailSectionState extends State<PainPointDetailSection> {
  @override
  Widget build(BuildContext context) {
    Widget _imagesSection(List<String> imagesUrl) {
      return Offstage(
        offstage: imagesUrl.length == 0,
        child: Container(
          child: Column(
            children: <Widget>[
              PaddingSet.PaddingTop(25),
              GridView.count(
                shrinkWrap: true,
                primary: false,
                crossAxisCount: 4,
                mainAxisSpacing: 15,
                crossAxisSpacing: 15,
                children: imagesUrl.map((imageUrl) {
                  return Image.asset(
                    imageUrl,
                    width: double.maxFinite,
                    height: double.maxFinite,
                    fit: BoxFit.fill,
                  );
                }).toList(),
              )
            ],
          ),
        ),
      );
    }

    return Container(
      padding: EdgeInsets.fromLTRB(16, 15, 16, 15),
      color: Colors.white,
      child: Column(
        children: <Widget>[
          Text(
            '因项目的技术原因进行拜访因项目的技术原因进行拜访因项目的技术原因进行拜访',
            style: TextStyle(
              color: AppColors.TextColor,
              fontSize: AppFontSizes.Font15,
              fontFamily: AppFontFamilies.PingFangSC,
              fontWeight: FontWeight.w500,
            ),
          ),
          _imagesSection([
            'images/lake.jpeg',
            'images/lake.jpeg',
            'images/lake.jpeg',
            'images/lake.jpeg',
            'images/lake.jpeg',
            'images/lake.jpeg',
          ]),
          PaddingSet.PaddingTop(25),
          Row(
            children: <Widget>[
              Container(
                width: 16,
                height: 16,
                color: AppColors.MainColor,
              ),
              PaddingSet.PaddingLeft(8),
              Expanded(
                child: Text(
                  '信兴拉链',
                  style: TextStyle(
                    color: AppColors.DetailTextColor,
                    fontSize: AppFontSizes.Font13,
                    fontFamily: AppFontFamilies.PingFangSC,
                    fontWeight: FontWeight.w500,
                  ),
                  overflow: TextOverflow.ellipsis,
                  maxLines: 1,
                ),
              )
            ],
          )
        ],
      ),
    );
  }
}
